package com.designpatterns.singleton;

public class SingletonPatternTest {
	public static void main(String[] args) {
		/* You shouldn't use singleton for database connection
		 * because some database driver is not thread safe.
		 * THIS IS BAD PRACTICE.
		 * Ref: http://goo.gl/rRWynH
		 */
		DatabaseConnection connection = DatabaseConnection.getInstance();
		connection.insert();
		connection.update();
		connection.delete();
		
		/*
		 * This is an acceptable use of singleton.
		 */
		Logger logger = Logger.getInstance();
		logger.debug();
	}
}
		